﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Srvtools;

namespace WTEvection
{
    public partial class Form2 : InfoForm
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void Form2_Load(object sender, EventArgs e)
        {
            this.inFlowFlag.SelectedIndex = -1;
        }

        private void butQuery_Click(object sender, EventArgs e)
        {
            string Sql = "(1=1) ";
            string str = "";
            str = this.txtEmp.Text.Trim();
            if (str != "")
            {
                Sql += " AND EmpName LIKE '%" + str + "%'";
            }

            if (this.inDepartment.SelectedIndex > -1)
            {
                if (this.inDepartment.SelectedValue.ToString() != "0")
                {
                    Sql += " AND Employees.DepartmentId ='" + inDepartment.SelectedValue.ToString() + "'";
                }
            }
            if (this.inFlowFlag.SelectedIndex>-1)
                Sql += " AND WorkTime_EvectionM.FlowFlag = '" + this.inFlowFlag.SelectedValue.ToString() + "'";

            idWorkTime_EvectionM.SetWhere(Sql);

        }

        
    }
}
